package com.starinside.wp.domain.comment;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.starinside.wp.domain.Domain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

/**
 * 评论对象
 */


@Entity
@Data
@Table(name = "tb_comments")
@EqualsAndHashCode(callSuper = true)
public class Comment extends Domain {

//    @Column(columnDefinition = "varchar(32) COMMENT '评论宿主对象 id")
//    private String exObjId;

    @ManyToOne
    @JoinColumn(name = "exObjId", columnDefinition = "varchar(32) COMMENT '评论宿主对象 id'")
    @JsonIgnore
    private ExtCommentsSupport extObj;

    @Column(columnDefinition = "int default 1 COMMENT '用户类型, 1. 家长； 2. 老师'")
    private int userType;

    @Column(columnDefinition = "varchar(255) COMMENT '评论用户名'")
    private String userName;

    @Column(columnDefinition = "varchar(32) COMMENT '关联用户 id'")
    private String childrenId;

    @Column(columnDefinition = "varchar(32) COMMENT '评论用户 id'")
    private String userId;

    @Column(columnDefinition = "varchar(255) COMMENT '评论的内容'")
    private String content;

    @Column(columnDefinition = "varchar(32) COMMENT '关联用户 id'")
    private String refUserId;

    @Column(columnDefinition = "varchar(32) COMMENT '关联宝宝 id'")
    private String refChildrenId;

    @Column(columnDefinition = "varchar(255) COMMENT '关联用户名'")
    private String refUserName;

    @Column(columnDefinition = "int default 1 COMMENT '关联用户类型, 1. 家长； 2. 老师'")
    private int refUserType;

}
